#!/usr/bin/env node

//拓展
function getCodeInfo(c) {
    return {
        "char": c,
        "UTF-8": c.charCodeAt(0).toString(16).padStart(2, '0'),
        "UTF-16": c.charCodeAt(0).toString(16).toUpperCase().padStart(4, '0')
    };
}

function main() {
    const msg = 'hello, 王顶';
    const codes = [...msg].map(getCodeInfo);
    console.table(codes);
}

main();